package com.liang.service.feign;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class PayServiceFallbackFactory implements FallbackFactory<PayService> {
    @Override
    public PayService create(Throwable throwable) {
        log.error("异常原因:{}", throwable.getMessage(), throwable);
        return new PayService() {
            @Override
            public String sayHi() {
                return "0.0";
            }

            @Override
            public String viewConfig() {
                return "=,=";
            }
        };
    }
}
